package file_functions;

import java.util.Comparator;

class Comp_name_1 implements Comparator<Files_info>
{
    public int compare(Files_info entry1, Files_info entry2) 
    {
    		int min = 0;
    		if (entry1.name.length() < entry2.name.length())
    			min = entry1.name.length();
    		else
    			min = entry2.name.length();
    		
    		if (entry1.name.equals(".."))
    			return (-1);
    		else if (entry2.name.equals(".."))
    			return (1);
    		
    		for (int i = 0; i < min; i++)
    		{
    			if (entry1.name.charAt(i) > entry2.name.charAt(i))
    				return (1);
    			else if (entry1.name.charAt(i) < entry2.name.charAt(i))
    				return (-1);
    		}
    		return (0);
    }
}
